package com.lzh.service;

import com.github.pagehelper.PageInfo;
import com.lzh.pojo.Teacher;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * @author reborn
 * @create 2020/5/18-23:53
 */
public interface TeacherService {


    //    查询全部教师
    PageInfo<Teacher> selectTeachers(Integer pageNum,Integer pageSize);

    //    根据权限查询
    PageInfo<Teacher> selectPerms(Integer pageNum,Integer pageSize,String perms);


    //    查询全部教师
    List<Teacher> selectTeachers();

    //    更新教师
    int updateTeacher(Teacher teacher);

    //    根据id查询教师
    PageInfo<Teacher> selectTeacherByIds(Integer pageNum, Integer pageSize, Set<Integer> ids);

    //    登录查询是否存在
    @Select("select * from teacher where zh=#{zh} and pwd=#{pwd}")
    Teacher selectTeacherZh(String zh,String pwd);

//    根据id查询教师
    Teacher selectTeacherById(int id);

    //    根据教师名字模糊查询
    PageInfo<Teacher>  selectTeaByName(Integer pageNum, Integer pageSize, String name);

    //    添加教师
    int insertTea(Teacher teacher);

    //    查找帐号是否重复
    Teacher selectZh(String zh);

    //删除
    int deleteTea(int id);


}
